Conversation
Adds @chat-adapter/state-dynamodb, a serverless-native state adapter using DynamoDB single-table design with DynamoDBDocument client. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Users typically already have @aws-sdk in their project. Peer deps avoid version conflicts and reduce bundle duplication. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@anatolzak is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
I'm not so sure about this one. Should it live inside or outside the repo? Would people actually use this? |
|
I would 100% use this, dynamodb is perfect for 100% serverless applications running on aws. Otherwise I'm forced to use a persistant state alternative. |
Extracts DynamoDBStateSharedOptions to avoid duplicating options across interfaces. Adds pkName, skName, and ttlName options so users can map to existing table schemas. Includes tests for all custom attribute name paths (subscribe, get, lock, cache, list trim, getList, refreshListTtl). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ProjectionExpression in isSubscribed and trimList used raw attribute names which would fail if pkName or skName is a DynamoDB reserved word. Now uses #pk and #sk placeholders everywhere. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
If it's worth something, I copied your implementation @anatolzak and it's working great. Only thing to consider is, optionally let me define the pk and sk attribute names to use, so that I can use it on my existing dynamodb table that might have a different pk and sk naming (in my case I use PK and SK in upper case). But might be better to have that fixed, not sure, just wanted to suggest that. |
|
@padapada09 thanks for the suggestion! I actually already did that right after your first comment 🙂 |
Closes #282
Summary
@chat-adapter/state-dynamodb— a serverless-native state adapter using DynamoDB single-table designpkName,skName, andttlNameoptions for mapping to existing table schemasDesign
pk/sk) with all record types (subscriptions, locks, cache, lists)expiresAt) for GC + app-levelexpiresAtMschecks for correctnessADD seq :one) + 16-digit zero-padded sort keysTest plan
pnpm validatepasses (typecheck, lint, knip, tests, build)DynamoDBDocumentclientpkName,skName,ttlNameacross all code paths (subscribe, get, lock, cache, list trim, getList, refreshListTtl)🤖 Generated with Claude Code